from typing import *


class Solution:

    def numWays(self, n: int) -> int:
        f = [0] * 3
        f[0] = 1
        mod = 1000000007
        for i in range(n):
            f[(i + 1) % 3] = (f[(i + 1) % 3] + f[i % 3]) % mod
            f[(i + 2) % 3] = f[i % 3] % mod
        return f[n % 3]


so = Solution()
print(so.numWays(7))